﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZOIL.DataModel;
using System.Windows.Input;
using System.Windows;
using ZOIL.Framework.Presentation;
using ZOIL.Library.Devices.OSC;
using Microsoft.Surface.Presentation.Controls;
using System.Windows.Controls;
using System.Windows.Media;

namespace ZOIL.Library.Components
{
    [ViewModelFor(typeof(ImageCardView))]
    public class ImageCardViewModel : BaseViewModel
    {

        public ImageCardViewModel()
            : base()
        {
            RegisterChangeNotification("ZoomLevel1", "ZoomLevel1");
            RegisterChangeNotification("ZoomLevel2", "ZoomLevel2");
            RegisterChangeNotification("ImgUrl", "ImgUrl");

            RegisterChangeNotification("ProID", "ProID");
            RegisterChangeNotification("CategoryID", "CategoryID");
            RegisterChangeNotification("CardID", "CardID");
            RegisterChangeNotification("Topic", "Topic");
            RegisterChangeNotification("LogoUrl", "LogoUrl");
            RegisterChangeNotification("TextureUrl", "TextureUrl");
            RegisterChangeNotification("LeftID", "LeftID");
            RegisterChangeNotification("RightID", "RightID");
            RegisterChangeNotification("TopID", "TopID");
            RegisterChangeNotification("BottomID", "BottomID");
            RegisterChangeNotification("FakeZoomLevelIn", "FakeZoomLevelIn");
            RegisterChangeNotification("FakeZoomLevelOut", "FakeZoomLevelOut");
        }

        public new ImageCard Model
        {
            get
            {
                return base.Model as ImageCard;
            }
            set
            {
                base.Model = value;
            }
        }

        public new object BaseModel
        {
            get
            {
                return base.Model;
            }
            set
            {
                base.Model = value;
            }
        }

        #region Properties

        public int? ProID
        {
            get
            {
                return (Model as ImageCard).ProID;
            }
            set
            {
                (Model as ImageCard).ProID = value;
                RaisePropertyChangedEvent("ProID");
            }
        }

        public int? CategoryID
        {
            get
            {
                return (Model as ImageCard).CategoryID;
            }
            set
            {
                (Model as ImageCard).CategoryID = value;
                RaisePropertyChangedEvent("CategoryID");
            }
        }

        public int? ZoomLevel1
        {
            get
            {
                return (Model as ImageCard).ZoomLevel1;
            }
            set
            {
                (Model as ImageCard).ZoomLevel1 = value;
                RaisePropertyChangedEvent("ZoomLevel1");
            }
        }

        public int? ZoomLevel2
        {
            get
            {
                return (Model as ImageCard).ZoomLevel2;
            }
            set
            {
                (Model as ImageCard).ZoomLevel2 = value;
                RaisePropertyChangedEvent("ZoomLevel2");
            }
        }


        public Uri ImgUrl
        {
            get
            {
                return new Uri((Model as ImageCard).ImgUrl);
            }
            set
            {
                (Model as ImageCard).ImgUrl = value.ToString();
                RaisePropertyChangedEvent("ImgUrl");
            }
        }

        public int? CardID
        {
            get
            {
                return (Model as ImageCard).CardID;
            }
            set
            {
                (Model as ImageCard).CardID = value;
                RaisePropertyChangedEvent("CardID");
            }
        }

        public int? Topic
        {
            get
            {
                return (Model as ImageCard).Topic;
            }
            set
            {
                (Model as ImageCard).Topic = value;
                RaisePropertyChangedEvent("Topic");
            }
        }

        public Uri LogoUrl
        {
            get
            {
                return new Uri((Model as ImageCard).LogoUrl);
            }
            set
            {
                (Model as ImageCard).LogoUrl = value.ToString();
                RaisePropertyChangedEvent("LogoUrl");
            }
        }

        public Uri TextureUrl
        {
            get
            {
                return new Uri((Model as ImageCard).TextureUrl);
            }
            set
            {
                (Model as ImageCard).TextureUrl = value.ToString();
                RaisePropertyChangedEvent("TextureUrl");
            }
        }

        public int? LeftID
        {
            get
            {
                return (Model as ImageCard).LeftID;
            }
            set
            {
                (Model as ImageCard).LeftID = value;
                RaisePropertyChangedEvent("LeftID");
            }
        }

        public int? RightID
        {
            get
            {
                return (Model as ImageCard).RightID;
            }
            set
            {
                (Model as ImageCard).RightID = value;
                RaisePropertyChangedEvent("RightID");
            }
        }

        public int? TopID
        {
            get
            {
                return (Model as ImageCard).TopID;
            }
            set
            {
                (Model as ImageCard).TopID = value;
                RaisePropertyChangedEvent("TopID");
            }
        }

        public int? BottomID
        {
            get
            {
                return (Model as ImageCard).BottomID;
            }
            set
            {
                (Model as ImageCard).BottomID = value;
                RaisePropertyChangedEvent("BottomID");
            }
        }

        public int? FakeZoomLevelOut
        {
            get
            {
                return (Model as ImageCard).FakeZoomLevelOut;
            }
            set
            {
                (Model as ImageCard).FakeZoomLevelOut = value;
                RaisePropertyChangedEvent("FakeZoomLevelOut");
            }
        }

        public int? FakeZoomLevelIn
        {
            get
            {
                return (Model as ImageCard).FakeZoomLevelIn;
            }
            set
            {
                (Model as ImageCard).FakeZoomLevelIn = value;
                RaisePropertyChangedEvent("FakeZoomLevelIn");
            }
        }

        #endregion Properties
    }
}
